package com.bbz.spring;

import com.bbz.spring.Service.MainService;
import com.bbz.spring.config.MainConfig5;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class MainTest5 {
    public static void main(String args[]) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfig5.class);
        for (String name : applicationContext.getBeanDefinitionNames()) {
            System.out.println(name);
        }

        MainService mainService = applicationContext.getBean(MainService.class);
        System.out.println(mainService);
    }
}
